﻿<%@ Page Title="" Language="C#" MasterPageFile="~/BackMaster2.Master" AutoEventWireup="true" CodeBehind="BulletinShowAll.aspx.cs" Inherits="BackStage.BulletinShowAll" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script src="BootstrapSouce/js/jquery.min.js"></script>
    <script>
        function SelectMessages(n) {
            $.getJSON("/Hand/BulletinShow.ashx", { id: n }, function (data) {
                    $("#BulletinID").html(n);
                    $("#B_Tile").html(data.B_Tile);
                    //转换时间格式
                    data.Publish_Time = data.Publish_Time.replace("/Date(", "").replace(")/", "");
                    if (data.Publish_Time.indexOf("+") > 0) {
                        data.Publish_Time = data.Publish_Time.substring(0, data.Publish_Time.indexOf("+"));
                    }
                    else if (data.Publish_Time.indexOf("-") > 0) {
                        data.Publish_Time = data.Publish_Time.substring(0, data.Publish_Time.indexOf("-"));
                    }
                    var date = new Date(parseInt(data.Publish_Time, 10));
                    var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
                    var currentDate = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
                    $("#Publish_Time").html(date.getFullYear() + " - " + month + " - " + currentDate);

                    $("#PT_Name").html(data.PT_Name);

                    $("#PV").html(data.PV);
                    $("#Publish_Content").html(data.Publish_Content);
                })
        }
    </script>
    <div class="container" style="width:100%;">
        <h2 style="text-align:center">公告详情</h2>
        <form id="form1" runat="server" >
            <div runat="server" style="float:right">
            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            <asp:Button ID="Button3" runat="server" style="margin-bottom:10px;border-radius:5px;box-shadow:10px;" CssClass="btn-primary" Width="60px"  Height="30px" Text="搜索" OnClick="Button3_Click" />
            </div>
            <br />
            <table class="table table-bordered table-hover table-striped" style="text-align:center">
                <asp:Repeater ID="Repeater1" runat="server" OnItemCommand="Repeater1_ItemCommand">
                    <HeaderTemplate>
                        <tr>
                            <th>广告编号</th>
                            <th>广告标题名称</th>
                            <th>发表时间</th>
                            <th>浏览量</th>
                            <th>所属类别</th>
                            <th>操作</th>
                        </tr>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr>
                            <td style="text-align:center;width:100px;"><%#Eval("BulletinID")%></td>
                            <td style="font-weight:bold;text-align:center;width:100px;"><a href="#" style="color:#0b3cfa" data-toggle="modal" data-target="#myModal1" onclick="SelectMessages(<%#Eval("BulletinID") %>)"><%#Eval("B_Tile")%></a></td>
                            <td style="text-align:center;width:100px;"><%#Eval("Publish_Time")%></td>
                            <td style="text-align:center;width:100px;"><%#Eval("PV")%></td>
                            <td style="text-align:center;width:100px;"><%#Eval("PT_Name")%></td>
                            <td style="text-align:center;width:100px;">
                                <asp:Button ID="Button1" runat="server" style="border-radius:5px;box-shadow:10px;"  CssClass="btn-primary" Width="60px"  Height="30px" Text="删除" Enabled="False" CommandName="del" CommandArgument='<%#Eval("BulletinID") %>' OnClientClick="return confirm('确认删除吗？')" />
                                <asp:Button ID="Button2" runat="server" style="border-radius:5px;box-shadow:10px;" CssClass="btn-primary" Width="60px"  Height="30px" Text="编辑" CommandName="upd" CommandArgument='<%#Eval("BulletinID") %>' />
                            </td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>
            </table>
            <br />
            <div style="text-align:center;margin-top:0px;">
            <webdiyer:AspNetPager ID="AspNetPager1" runat="server"  FirstPageText=" 首页" LastPageText="尾页" NextPageText="下一页" OnPageChanged="AspNetPager1_PageChanged" PrevPageText="上一页" ShowPageIndexBox="Always" SubmitButtonText="跳转"></webdiyer:AspNetPager>
            <br /><span>友情提示：数据无价，最高权限管理员可操作删除数据</span>
            </div>
        </form>
    </div>

    <div class="modal fade" id="myModal1" style="display:none" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="myModalLabel1">广告详情信息</h4>
                </div>
                <div id="xiangqing_Memloan" class="modal-body">

                    <%-- 模态框标头显示 --%>
                    <ul id="myTab1" class="nav nav-tabs">
                        <li class="active">
                            <a href="#home" data-toggle="tab">广告信息
                            </a>
                        </li>
                    </ul>
                    <%-- 模态框内容显示 --%>
                    <div id="myTabContent1" class="tab-content">
                        <%-- 会员详情 --%>
                        <div class="tab-pane fade in active" id="home1">

                            <table class="table">
                                <tr>
                                    <td style="width:100px;">广告编号：</td>
                                    <td>
                                        <label id="BulletinID"></label>
                                    </td>
                                </tr>
                                <tr>
                                   
                                    <td>广告标题：</td>
                                    <td>
                                        <label id="B_Tile"></label>
                                    </td>
                                </tr>
                                <tr>
                                    <td>发布时间：</td>
                                    <td>
                                        <label id="Publish_Time"></label>
                                    </td>
                                    
                                </tr>
                                 <tr>
                                   
                                    <td>类别名称：</td>
                                    <td>
                                        <label id="PT_Name"></label>
                                    </td>
                                </tr>
                                <tr>
                                    <td>浏览量：</td>
                                    <td>
                                        <label id="PV"></label>
                                    </td>
                                   
                                </tr>
                                <tr>
                                    <td>发布内容：</td>
                                    <td>
                                        <label id="Publish_Content"></label>
                                    </td>
                                </tr>
                            </table>
                        </div>
                       
                    </div>
                </div>
                <%-- 模态框的尾部 --%>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">
                        关闭
                    </button>
                    <%--  <button type="button" class="btn btn-primary">
                        提交更改
                    </button>--%>
                </div>
            </div>
            <!-- /.modal-content -->
        </div>
        <!-- /.modal -->
    </div>
</asp:Content>

